package com.manager.api;

import com.manager.base.BaseResponse;
import com.manager.controller.BaseController;
import com.manager.entity.Carousels;
import com.manager.service.CarouselsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zhou
 * @date 2021/07/18 14:27
 **/
@RestController()
@RequestMapping("/api/home")
public class CarouselsController extends BaseController {

  @Resource
  private CarouselsService carouselsService;

  @GetMapping("/carousels")
  public BaseResponse getCarousel() {
    List<Carousels> carousels = carouselsService.selectCarousels();
    return BaseResponse.success("首页信息返回成功", carousels);
  }
}
